<!DOCTYPE html>
<html id="docs" lang="en" class="">
	<head>
	<meta charset="utf-8">
<title>Running Kubernetes on Google Compute Engine - Kubernetes</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="../../../../images/favicon.png">
<link rel="stylesheet" type="text/css" href="../../../../css/base_fonts.css">
<link rel="stylesheet" type="text/css" href="../../../../css/styles.css">
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="../../../../css/callouts.css">
<link rel="stylesheet" type="text/css" href="../../../../css/custom-jekyll/tags.css">




<meta name="description" content="Running Kubernetes on Google Compute Engine" />
<meta property="og:description" content="Running Kubernetes on Google Compute Engine" />

<meta property="og:url" content="https://kubernetes.io/docs/setup/turnkey/gce/" />
<meta property="og:title" content="Running Kubernetes on Google Compute Engine - Kubernetes" />

<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="../../../../js/script.js"></script>
<script src="../../../../js/custom-jekyll/tags.js"></script>


	</head>
	<body>
		<div id="cellophane" onclick="kub.toggleMenu()"></div>

<header>
    <a href="../../../../index.html" class="logo"></a>

    <div class="nav-buttons" data-auto-burger="primary">
        <ul class="global-nav">
            
            
            <li><a href="../../../home.1">Documentation</a></li>
            
            <li><a href="../../../../blog/index.html">Blog</a></li>
            
            <li><a href="../../../../partners/index.html">Partners</a></li>
            
            <li><a href="../../../../community/index.html">Community</a></li>
            
            <li><a href="../../../../case-studies/index.html">Case Studies</a></li>
            
            
             <li>
                <a href="index.html#">
                    English <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="../../../../zh/index.html">中文 Chinese</a></li>
                
                    <li><a href="../../../../ko/index.html">한국어 Korean</a></li>
                
                </ul>
            </li>
         
            <li>
                <a href="index.html#">
                    v1.11 <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="https://kubernetes.io">v1.12</a></li>
                
                    <li><a href="../../../../index.html">v1.11</a></li>
                
                    <li><a href="https://v1-10.docs.kubernetes.io">v1.10</a></li>
                
                    <li><a href="https://v1-9.docs.kubernetes.io">v1.9</a></li>
                
                </ul>
            </li>
        </ul>
        
        <a href="../../../tutorials/kubernetes-basics/index.html" class="button" id="tryKubernetes" data-auto-burger-exclude>Try Kubernetes</a>
        <button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
    </div>

    <nav id="mainNav">
        <main data-auto-burger="primary">
        <div class="nav-box">
            <h3><a href="../../../tutorials/stateless-application/hello-minikube/index.html">Get Started</a></h3>
            <p>Ready to get your hands dirty? Build a simple Kubernetes cluster that runs "Hello World" for Node.js.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../home.1">Documentation</a></h3>
            <p>Learn how to use Kubernetes with the use of walkthroughs, samples, and reference documentation. You can even <a href="../../../../editdocs/index.html" data-auto-burger-exclude>help contribute to the docs</a>!</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../../community/index.html">Community</a></h3>
            <p>If you need help, you can connect with other Kubernetes users and the Kubernetes authors, attend community events, and watch video presentations from around the web.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../../blog/index.html">Blog</a></h3>
            <p>Read the latest news for Kubernetes and the containers space in general, and get technical how-tos hot off the presses.</p>
        </div>
        </main>
        <main data-auto-burger="primary">
        <div class="left">
            <h5 class="github-invite">Interested in hacking on the core Kubernetes code base?</h5>
            <a href="https://github.com/kubernetes/kubernetes" class="button" data-auto-burger-exclude>View On Github</a>
        </div>

        <div class="right">
            <h5 class="github-invite">Explore the community</h5>
            <div class="social">
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>Twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
        </div>
        <div class="clear" style="clear: both"></div>
        </main>
    </nav>
</header>

		
		
		<section id="hero" class="light-text no-sub">
			







<h1>Setup</h1>
<h5></h5>










<div id="vendorStrip" class="light-text">
	<ul>
		
		
		<li><a href="../../../home.1">DOCUMENTATION</a></li>
		
		
		<li><a href="../../index.html" class="YAH">SETUP</a></li>
		
		
		<li><a href="../../../concepts/index.html">CONCEPTS</a></li>
		
		
		<li><a href="../../../tasks/index.html">TASKS</a></li>
		
		
		<li><a href="../../../tutorials/index.html">TUTORIALS</a></li>
		
		
		<li><a href="../../../reference.1">REFERENCE</a></li>
		
	</ul>
	<div id="searchBox">
		<input type="text" id="search" placeholder="Search" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
	</div>
</div>

		</section>
		
		
<section id="deprecationWarning">
  <main>
    <div class="content deprecation-warning">
      <h3>
        Documentation for Kubernetes v1.11 is no longer actively maintained. The version you are currently viewing is a static snapshot.
        For up-to-date documentation, see the <a href="https://kubernetes.io/docs/home/">latest</a> version.
      </h3>
    </div>
  </main>
</section>


		<section id="encyclopedia">
			
<div id="docsToc">
     <div class="pi-accordion">
    	
        
        
        
        
        
         
             
                 
             
         
             
                 
                          
                          
                 
             
         
             
         
             
         
             
         
             
         
             
         
             
         
         
        
        <a class="item" data-title="Setup" href="../../index.html"></a>

	
	
		
		
	<div class="item" data-title="Bootstrapping Clusters with kubeadm">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Customizing control plane configuration with kubeadm" href="../../independent/control-plane-flags/index.html"></a>

		
	
		
		
<a class="item" data-title="Creating Highly Available Clusters with kubeadm" href="../../independent/high-availability.1"></a>

		
	
		
		
<a class="item" data-title="Creating a single master cluster with kubeadm" href="../../../getting-started-guides/kubeadm/index.html"></a>

		
	
		
		
<a class="item" data-title="Troubleshooting kubeadm" href="../../independent/troubleshooting-kubeadm/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Turnkey Cloud Solutions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Running Kubernetes on AWS EC2" href="../aws/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Alibaba Cloud" href="../alibaba-cloud/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Azure" href="../azure/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on CenturyLink Cloud" href="../clc/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Google Compute Engine" href="index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Multiple Clouds with Stackpoint.io" href="../stackpoint/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="On-Premises VMs">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Cloudstack" href="../../../getting-started-guides/cloudstack/index.html"></a>

		
	
		
		
<a class="item" data-title="Kubernetes on DCOS" href="../../../getting-started-guides/dcos/index.html"></a>

		
	
		
		
<a class="item" data-title="oVirt" href="../../../getting-started-guides/ovirt.1"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Custom Cloud Solutions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="CoreOS on AWS or GCE" href="../../../getting-started-guides/coreos.1"></a>

		
	
		
		
<a class="item" data-title="Installing Kubernetes On-premises/Cloud Providers with Kubespray" href="../../../getting-started-guides/kubespray/index.html"></a>

		
	
		
		
<a class="item" data-title="Installing Kubernetes on AWS with kops" href="../../custom-cloud/kops.1"></a>

		
	

		</div>
	</div>

		
	
		
		
<a class="item" data-title="Building Large Clusters" href="../../cluster-large/index.html"></a>

		
	
		
		
<a class="item" data-title="Building from Source" href="../../building-from-source/index.html"></a>

		
	
		
		
<a class="item" data-title="Configuring Kubernetes with Salt" href="../../salt/index.html"></a>

		
	
		
		
<a class="item" data-title="Creating a Custom Cluster from Scratch" href="../../../getting-started-guides/scratch/index.html"></a>

		
	
		
		
<a class="item" data-title="Picking the Right Solution" href="../../../getting-started-guides/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes Locally via Minikube" href="../../../getting-started-guides/minikube/index.html"></a>

		
	
		
		
<a class="item" data-title="Running in Multiple Zones" href="../../multiple-zones.1"></a>

		
	
		
		
<a class="item" data-title="Validate Node Setup" href="../../node-conformance/index.html"></a>

		
	






     </div> 
    <button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
</div> 

			<div id="docsContent">
				
<p><a href="../../../editdocs#docs/setup/turnkey/gce.md" id="editPageButton">Edit This Page</a></p>

<h1>Running Kubernetes on Google Compute Engine</h1>





<p>The example below creates a Kubernetes cluster with 4 worker node Virtual Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This cluster is set up and controlled from your workstation (or wherever you find convenient).</p>

<nav id="TableOfContents">
<ul>
<li>
<ul>
<li>
<ul>
<li><a href="index.html#before-you-start">Before you start</a></li>
<li><a href="index.html#prerequisites">Prerequisites</a></li>
<li><a href="index.html#starting-a-cluster">Starting a cluster</a></li>
<li><a href="index.html#installing-the-kubernetes-command-line-tools-on-your-workstation">Installing the Kubernetes command line tools on your workstation</a></li>
<li><a href="index.html#getting-started-with-your-cluster">Getting started with your cluster</a>
<ul>
<li><a href="index.html#inspect-your-cluster">Inspect your cluster</a></li>
<li><a href="index.html#run-some-examples">Run some examples</a></li>
</ul></li>
<li><a href="index.html#tearing-down-the-cluster">Tearing down the cluster</a></li>
<li><a href="index.html#customizing">Customizing</a></li>
<li><a href="index.html#troubleshooting">Troubleshooting</a>
<ul>
<li><a href="index.html#project-settings">Project settings</a></li>
<li><a href="index.html#cluster-initialization-hang">Cluster initialization hang</a></li>
<li><a href="index.html#ssh">SSH</a></li>
<li><a href="index.html#networking">Networking</a></li>
</ul></li>
</ul></li>
<li><a href="index.html#support-level">Support Level</a></li>
<li><a href="index.html#further-reading">Further reading</a></li>
</ul></li>
</ul>
</nav>

<h3 id="before-you-start">Before you start</h3>

<p>If you want a simplified getting started experience and GUI for managing clusters, please consider trying <a href="https://cloud.google.com/kubernetes-engine/" target="_blank">Google Kubernetes Engine</a> for hosted cluster installation and management.</p>

<p>For an easy way to experiment with the Kubernetes development environment, click the button below
to open a Google Cloud Shell with an auto-cloned copy of the Kubernetes source repo.</p>

<p><a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/kubernetes/kubernetes&amp;page=editor&amp;open_in_editor=README.md" target="_blank"><img src="http://gstatic.com/cloudssh/images/open-btn.png" alt="Open in Cloud Shell" /></a></p>

<p>If you want to use custom binaries or pure open source Kubernetes, please continue with the instructions below.</p>

<h3 id="prerequisites">Prerequisites</h3>

<ol>
<li>You need a Google Cloud Platform account with billing enabled. Visit the <a href="https://console.cloud.google.com" target="_blank">Google Developers Console</a> for more details.</li>
<li>Install <code>gcloud</code> as necessary. <code>gcloud</code> can be installed as a part of the <a href="https://cloud.google.com/sdk/" target="_blank">Google Cloud SDK</a>.</li>
<li>Enable the <a href="https://console.developers.google.com/apis/api/replicapool.googleapis.com/overview" target="_blank">Compute Engine Instance Group Manager API</a> in the <a href="https://console.developers.google.com/apis/library" target="_blank">Google Cloud developers console</a>.</li>
<li>Make sure that gcloud is set to use the Google Cloud Platform project you want. You can check the current project using <code>gcloud config list project</code> and change it via <code>gcloud config set project &lt;project-id&gt;</code>.</li>
<li>Make sure you have credentials for GCloud by running <code>gcloud auth login</code>.</li>
<li>(Optional)  In order to make API calls against GCE, you must also run <code>gcloud auth application-default login</code>.</li>
<li>Make sure you can start up a GCE VM from the command line.  At least make sure you can do the <a href="https://cloud.google.com/compute/docs/instances/#startinstancegcloud" target="_blank">Create an instance</a> part of the GCE Quickstart.</li>
<li>Make sure you can SSH into the VM without interactive prompts.  See the <a href="https://cloud.google.com/compute/docs/instances/#sshing" target="_blank">Log in to the instance</a> part of the GCE Quickstart.</li>
</ol>

<h3 id="starting-a-cluster">Starting a cluster</h3>

<p>You can install a client and start a cluster with either one of these commands (we list both in case only one is installed on your machine):</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -sS https://get.k8s.io | bash</code></pre></div>
<p>or</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">wget -q -O - https://get.k8s.io | bash</code></pre></div>
<p>Once this command completes, you will have a master VM and four worker VMs, running as a Kubernetes cluster.</p>

<p>By default, some containers will already be running on your cluster. Containers like <code>fluentd</code> provide <a href="../../../concepts/cluster-administration/logging.1">logging</a>, while <code>heapster</code> provides <a href="http://releases.k8s.io/master/cluster/addons/cluster-monitoring/README.md" target="_blank">monitoring</a> services.</p>

<p>The script run by the commands above creates a cluster with the name/prefix &ldquo;kubernetes&rdquo;. It defines one specific cluster config, so you can&rsquo;t run it more than once.</p>

<p>Alternately, you can download and install the latest Kubernetes release from <a href="https://github.com/kubernetes/kubernetes/releases" target="_blank">this page</a>, then run the <code>&lt;kubernetes&gt;/cluster/kube-up.sh</code> script to start the cluster:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#a2f">cd</span> kubernetes
cluster/kube-up.sh</code></pre></div>
<p>If you want more than one cluster running in your project, want to use a different name, or want a different number of worker nodes, see the <code>&lt;kubernetes&gt;/cluster/gce/config-default.sh</code> file for more fine-grained configuration before you start up your cluster.</p>

<p>If you run into trouble, please see the section on <a href="https://v1-11.docs.kubernetes.io/docs/getting-started-guides/gce/#troubleshooting">troubleshooting</a>, post to the
<a href="https://groups.google.com/forum/#!forum/kubernetes-users" target="_blank">kubernetes-users group</a>, or come ask questions on <a href="../../../troubleshooting/index.html#slack">Slack</a>.</p>

<p>The next few steps will show you:</p>

<ol>
<li>How to set up the command line client on your workstation to manage the cluster</li>
<li>Examples of how to use the cluster</li>
<li>How to delete the cluster</li>
<li>How to start clusters with non-default options (like larger clusters)</li>
</ol>

<h3 id="installing-the-kubernetes-command-line-tools-on-your-workstation">Installing the Kubernetes command line tools on your workstation</h3>

<p>The cluster startup script will leave you with a running cluster and a <code>kubernetes</code> directory on your workstation.</p>

<p>The <a href="../../../user-guide/kubectl/index.html">kubectl</a> tool controls the Kubernetes cluster
manager.  It lets you inspect your cluster resources, create, delete, and update
components, and much more. You will use it to look at your new cluster and bring
up example apps.</p>

<p>You can use <code>gcloud</code> to install the <code>kubectl</code> command-line tool on your workstation:</p>

<pre><code>gcloud components install kubectl
</code></pre>

<p><strong>Note:</strong> The kubectl version bundled with <code>gcloud</code> may be older than the one
downloaded by the get.k8s.io install script. See <a href="../../../tasks/kubectl/install/index.html">Installing kubectl</a>
document to see how you can set up the latest <code>kubectl</code> on your workstation.</p>

<h3 id="getting-started-with-your-cluster">Getting started with your cluster</h3>

<h4 id="inspect-your-cluster">Inspect your cluster</h4>

<p>Once <code>kubectl</code> is in your path, you can use it to look at your cluster. E.g., running:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl get --all-namespaces services</code></pre></div>
<p>should show a set of <a href="../../../user-guide/services">services</a> that look something like this:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">NAMESPACE     NAME                  CLUSTER_IP       EXTERNAL_IP       PORT<span style="color:#666">(</span>S<span style="color:#666">)</span>        AGE
default       kubernetes            <span style="color:#666">10</span>.0.0.1         &lt;none&gt;            <span style="color:#666">443</span>/TCP        1d
kube-system   kube-dns              <span style="color:#666">10</span>.0.0.2         &lt;none&gt;            <span style="color:#666">53</span>/TCP,53/UDP  1d
kube-system   kube-ui               <span style="color:#666">10</span>.0.0.3         &lt;none&gt;            <span style="color:#666">80</span>/TCP         1d
...</code></pre></div>
<p>Similarly, you can take a look at the set of <a href="../../../user-guide/pods">pods</a> that were created during cluster startup.
You can do this via the</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl get --all-namespaces pods</code></pre></div>
<p>command.</p>

<p>You&rsquo;ll see a list of pods that looks something like this (the name specifics will be different):</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">NAMESPACE     NAME                                           READY     STATUS    RESTARTS   AGE
kube-system   fluentd-cloud-logging-kubernetes-minion-63uo   <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          14m
kube-system   fluentd-cloud-logging-kubernetes-minion-c1n9   <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          14m
kube-system   fluentd-cloud-logging-kubernetes-minion-c4og   <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          14m
kube-system   fluentd-cloud-logging-kubernetes-minion-ngua   <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          14m
kube-system   kube-dns-v5-7ztia                              <span style="color:#666">3</span>/3       Running   <span style="color:#666">0</span>          15m
kube-system   kube-ui-v1-curt1                               <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          15m
kube-system   monitoring-heapster-v5-ex4u3                   <span style="color:#666">1</span>/1       Running   <span style="color:#666">1</span>          15m
kube-system   monitoring-influx-grafana-v1-piled             <span style="color:#666">2</span>/2       Running   <span style="color:#666">0</span>          15m</code></pre></div>
<p>Some of the pods may take a few seconds to start up (during this time they&rsquo;ll show <code>Pending</code>), but check that they all show as <code>Running</code> after a short period.</p>

<h4 id="run-some-examples">Run some examples</h4>

<p>Then, see <a href="../../../user-guide/simple-nginx">a simple nginx example</a> to try out your new cluster.</p>

<p>For more complete applications, please look in the <a href="https://github.com/kubernetes/examples/tree/v1.11.3/" target="_blank">examples directory</a>.  The <a href="https://github.com/kubernetes/examples/tree/v1.11.3/guestbook/" target="_blank">guestbook example</a> is a good &ldquo;getting started&rdquo; walkthrough.</p>

<h3 id="tearing-down-the-cluster">Tearing down the cluster</h3>

<p>To remove/delete/teardown the cluster, use the <code>kube-down.sh</code> script.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#a2f">cd</span> kubernetes
cluster/kube-down.sh</code></pre></div>
<p>Likewise, the <code>kube-up.sh</code> in the same directory will bring it back up. You do not need to rerun the <code>curl</code> or <code>wget</code> command: everything needed to setup the Kubernetes cluster is now on your workstation.</p>

<h3 id="customizing">Customizing</h3>

<p>The script above relies on Google Storage to stage the Kubernetes release. It
then will start (by default) a single master VM along with 4 worker VMs.  You
can tweak some of these parameters by editing <code>kubernetes/cluster/gce/config-default.sh</code>
You can view a transcript of a successful cluster creation
<a href="https://gist.github.com/satnam6502/fc689d1b46db9772adea" target="_blank">here</a>.</p>

<h3 id="troubleshooting">Troubleshooting</h3>

<h4 id="project-settings">Project settings</h4>

<p>You need to have the Google Cloud Storage API, and the Google Cloud Storage
JSON API enabled. It is activated by default for new projects. Otherwise, it
can be done in the Google Cloud Console.  See the <a href="https://cloud.google.com/storage/docs/json_api/" target="_blank">Google Cloud Storage JSON
API Overview</a> for more
details.</p>

<p>Also ensure that&ndash; as listed in the <a href="index.html#prerequisites">Prerequisites section</a>&ndash; you&rsquo;ve enabled the <code>Compute Engine Instance Group Manager API</code>, and can start up a GCE VM from the command line as in the <a href="https://cloud.google.com/compute/docs/quickstart" target="_blank">GCE Quickstart</a> instructions.</p>

<h4 id="cluster-initialization-hang">Cluster initialization hang</h4>

<p>If the Kubernetes startup script hangs waiting for the API to be reachable, you can troubleshoot by SSHing into the master and node VMs and looking at logs such as <code>/var/log/startupscript.log</code>.</p>

<p><strong>Once you fix the issue, you should run <code>kube-down.sh</code> to cleanup</strong> after the partial cluster creation, before running <code>kube-up.sh</code> to try again.</p>

<h4 id="ssh">SSH</h4>

<p>If you&rsquo;re having trouble SSHing into your instances, ensure the GCE firewall
isn&rsquo;t blocking port 22 to your VMs.  By default, this should work but if you
have edited firewall rules or created a new non-default network, you&rsquo;ll need to
expose it: <code>gcloud compute firewall-rules create default-ssh --network=&lt;network-name&gt;
--description &quot;SSH allowed from anywhere&quot; --allow tcp:22</code></p>

<p>Additionally, your GCE SSH key must either have no passcode or you need to be
using <code>ssh-agent</code>.</p>

<h4 id="networking">Networking</h4>

<p>The instances must be able to connect to each other using their private IP. The
script uses the &ldquo;default&rdquo; network which should have a firewall rule called
&ldquo;default-allow-internal&rdquo; which allows traffic on any port on the private IPs.
If this rule is missing from the default network or if you change the network
being used in <code>cluster/config-default.sh</code> create a new rule with the following
field values:</p>

<ul>
<li>Source Ranges: <code>10.0.0.0/8</code></li>
<li>Allowed Protocols and Port: <code>tcp:1-65535;udp:1-65535;icmp</code></li>
</ul>

<h2 id="support-level">Support Level</h2>

<table>
<thead>
<tr>
<th>IaaS Provider</th>
<th>Config. Mgmt</th>
<th>OS</th>
<th>Networking</th>
<th>Docs</th>
<th>Conforms</th>
<th>Support Level</th>
</tr>
</thead>

<tbody>
<tr>
<td>GCE</td>
<td>Saltstack</td>
<td>Debian</td>
<td>GCE</td>
<td><a href="https://v1-11.docs.kubernetes.io/docs/getting-started-guides/gce/">docs</a></td>
<td></td>
<td>Project</td>
</tr>
</tbody>
</table>

<p>For support level information on all solutions, see the <a href="../../../getting-started-guides/index.html#table-of-solutions">Table of solutions</a> chart.</p>

<h2 id="further-reading">Further reading</h2>

<p>Please see the <a href="../../../index.html">Kubernetes docs</a> for more details on administering
and using a Kubernetes cluster.</p>



				<div class="issue-button-container">
					<p><a href="index.html"><img src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/setup/turnkey/gce.md?pixel" alt="Analytics" /></a></p>
					
					
					<script type="text/javascript">
					PDRTJS_settings_8345992 = {
					"id" : "8345992",
					"unique_id" : "\/docs\/setup\/turnkey\/gce\/",
					"title" : "Running Kubernetes on Google Compute Engine",
					"permalink" : "https:\/\/kubernetes.io\/docs\/setup\/turnkey\/gce\/"
					};
					(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
					</script>
					<a href="index.html" onclick="window.open('https://github.com/kubernetes/website/issues/new?title=Issue%20with%20' +
					'k8s.io'+window.location.pathname)" class="button issue">Create an Issue</a>
					
					
					
					<a href="../../../editdocs#docs/setup/turnkey/gce.md" class="button issue">Edit this Page</a>
					
				</div>
			</div>
		</section>
		<footer>
    <main class="light-text">
        <nav>
            
            
            
            <a href="../../../home.1">Documentation</a>
            
            <a href="../../../../blog/index.html">Blog</a>
            
            <a href="../../../../partners/index.html">Partners</a>
            
            <a href="../../../../community/index.html">Community</a>
            
            <a href="../../../../case-studies/index.html">Case Studies</a>
            
        </nav>
        <div class="social">
            <div>
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
            </div>
            <div>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
            <div>
                <a href="../../../getting-started-guides/index.html" class="button">Get Kubernetes</a>
                <a href="https://git.k8s.io/community/contributors/guide" class="button">Contribute</a>
            </div>
        </div>
        <div id="miceType" class="center">
            &copy; 2018 The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>
        </div>
        <div id="miceType" class="center">
            Copyright &copy; 2018 The Linux Foundation&reg;. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>
        </div>
    </main>
</footer>

		<button class="flyout-button" onclick="kub.toggleToc()"></button>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36037335-10', 'auto');
ga('send', 'pageview');


(function () {
    window.addEventListener('DOMContentLoaded', init)

        
        function init() {
            window.removeEventListener('DOMContentLoaded', init)
                hideNav()
        }

    function hideNav(toc){
        if (!toc) toc = document.querySelector('#docsToc')
        if (!toc) return
            var container = toc.querySelector('.container')

                
                if (container) {
                    if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) {
                        toc.style.display = 'none'
                            document.getElementById('docsContent').style.width = '100%'
                    }
                } else {
                    requestAnimationFrame(function () {
                        hideNav(toc)
                    })
                }
    }
})();
</script>



	</body>
</html>